package com.gs.coursera.algorithms.core.graph;


public abstract class DirectedGraph<T, W extends Comparable<W>> extends Graph<T, W>{
	

	public DirectedGraph(int vertexCount) {
		super(vertexCount);
	}

	@Override
	public void addEdge(T source, T target, W weight) {
		
	}

	@Override
	public void addEdge(Vertex<T, W> v1, Vertex<T, W> v2,
			W weight) {
		if(null != v1 && null != v2){
			Edge<T, W> edge = new Edge<T, W>(v1, v2, weight);
			edge.setDirected(true);
			v1.addAdjacentEdge(edge);
			getEdges().add(edge);
		}
	}
	
	public abstract boolean hasCycle();
	public abstract boolean hasCycle(Vertex<T, W> v);
	
}
